Repository navigation
feat(planners): port BasePlanner, BuiltInPlanner and PlanReActPlanner - #941
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
5dc1121 to
725f8cd
Compare
AmaadMartin
left a comment
There was a problem hiding this comment.
Faithful port of adk-python v0.1.0 planners, verified field by field against the reference (base, built-in, plan-re-act). The three classes reach the public API through common.ts and index.ts; the Python helper methods are extracted to module functions; the code uses native @google/genai types and adds no type suppressions or instanceof checks. The tests pin the instruction text and the response processing, including the deliberate copy-instead-of-mutate change from the Python source. CI: run-tests passed on ubuntu and was still running on macos and windows at review time, and cla/google reported a failure, which is not a code issue in the diff.
AmaadMartin
left a comment
There was a problem hiding this comment.
Approved. This is a faithful port of the adk-python v0.1.0 planners, checked field by field against the v0.1.0 source: the base class, the built-in planner, the Plan-Re-Act logic, and the instruction text (pinned character for character, including the should be be under typo). Exports, types, and tests are correct, with no suppressions and no instanceof. One optional note below. CI: run-tests passed on all three platforms; cla/google shows a failure, which is a contributor-agreement gate and not a code issue.
| handleNonFunctionCallPart(part, preservedParts); | ||
| } | ||
|
|
||
| if (firstFcPartIndex > 0) { |
There was a problem hiding this comment.
Nit, optional. This guard matches adk-python v0.1.0, so no change is needed for this port.
Note for awareness: upstream later changed it to >= 0. With > 0, a response that starts with a function call keeps only the first call and drops the following consecutive calls. Confirm you want the v0.1.0 behaviour.
AmaadMartin
left a comment
There was a problem hiding this comment.
Faithful port of adk-python v0.1.0 planners, verified field by field against the v0.1.0 reference. The > 0 guard in processPlanningResponse, the be be typo in the instruction text, and the absence of tag-stripping all match v0.1.0; adk-python added the later variants after v0.1.0. The three classes reach the public API through common.ts, use native @google/genai types, and add no any, instanceof, or suppressions. The markAsThought copy-instead-of-mutate change is a safe JS convention, and the tests pin it. CI: all four run-tests jobs passed at the head SHA; cla/google failed, which is a contributor-agreement matter outside the diff.
AmaadMartin
left a comment
There was a problem hiding this comment.
Approved. Faithful port of the adk-python v0.1.0 planners, verified field by field against the reference at the head SHA (base_planner, built_in_planner, plan_re_act_planner). No type suppressions, no instanceof, and the three classes are exported from common.ts. My earlier note on the > 0 guard (plan_re_act_planner.ts:69) is an optional nit that matches v0.1.0, not a blocker. CI was green at review time.
AmaadMartin
left a comment
There was a problem hiding this comment.
Re-verified at head 725f8cd against adk-python v0.1.0: a faithful, field-by-field port of BasePlanner, BuiltInPlanner and PlanReActPlanner. The three classes are exported through common.ts and reach index.ts by export * from './common.js'. The diff adds no type suppressions, no instanceof, and no console.log. My one open comment is an optional nit: the firstFcPartIndex > 0 guard matches v0.1.0 (line 72), so no change is needed. CI note: run-tests passes on all platforms; cla/google fails, which is a contributor-agreement gate, not a code defect.
## Task Port the planners package of adk-python v0.1.0 (src/google/adk/planners: base_planner.py, built_in_planner.py, plan_re_act_planner.py) into adk-js as core/src/planners. This is a new capability. No planner code exists in adk-js today. Wiring a planner into LlmAgent and a planning request/response processor is NOT part of this task (see open_questions). Produced by Foundry (task c1351db8-b98b-4369-907a-0b6fee584dc8). Reviewed by an automated reviewer before upload; still needs human review.
725f8cd to
8a25b27
Compare
|
Foundry merge critic: APPROVE Adds a TypeScript port of the Python ADK planners (BasePlanner, BuiltInPlanner, PlanReActPlanner), exports them from the common entry point, and adds unit tests for them. Rubric — the default is approve; each rule is a reason a human should read this change first. [no ] public_api — adds three new named exports in core/src/common.ts, and no existing export or signature changes Posted by Foundry's merge critic as evidence rather than a request, so nothing here is waiting on you. Advisory only: Foundry has given no approval. |
AmaadMartin
left a comment
There was a problem hiding this comment.
Approve. This is a faithful port of the adk-python v0.1.0 planners. I verified three things: the classes export through common.ts and index.ts, the helpers are module-level functions, and the diff adds no type suppressions or instanceof checks. My one open comment on line 69 is an optional nit -- the > 0 guard matches v0.1.0, and main later changed it to >= 0. CI was green and the PR is already merged.
…google#941) ## Task Port the planners package of adk-python v0.1.0 (src/google/adk/planners: base_planner.py, built_in_planner.py, plan_re_act_planner.py) into adk-js as core/src/planners. This is a new capability. No planner code exists in adk-js today. Wiring a planner into LlmAgent and a planning request/response processor is NOT part of this task (see open_questions). Produced by Foundry (task c1351db8-b98b-4369-907a-0b6fee584dc8). Reviewed by an automated reviewer before upload; still needs human review.
Task
Port the planners package of adk-python v0.1.0 (src/google/adk/planners: base_planner.py, built_in_planner.py, plan_re_act_planner.py) into adk-js as core/src/planners. This is a new capability. No planner code exists in adk-js today. Wiring a planner into LlmAgent and a planning request/response processor is NOT part of this task (see open_questions).
Produced by Foundry (task c1351db8-b98b-4369-907a-0b6fee584dc8). Reviewed by an automated
reviewer before upload; still needs human review.